<?php
/**
 ***********************************************************************************************************************
 * 安能接口获取网点信息接口
 * @author ldh
 ***********************************************************************************************************************
 */
namespace soa\partner\ane;

/**
 * Class Branch
 * @package soa\partner\ane
 */
class Branch extends BaseInformation
{
    /*****************************安能返回结果有个rdStatus字段，为1时才是有效的****************************************/

    /**
     * @param string $date
     * @return bool|null
     */
    public function getBranch($date = '')
    {
        return $this->send('siteListService', [
            'downloadTime' => strtotime(strtotime($date) !== false ? $date : '2000-01-01') * 1000,
        ]);
    }

    /**
     * @param $branchCode
     * @return bool|null
     */
    public function getBranchDetail($branchCode)
    {
        return $this->send('siteServiceImpl', [
            'siteCode'   => $branchCode,
        ]);
    }

    /**
     * @return bool|null
     */
    public function getProvinceList()
    {
        return $this->send('provinceListService', [
            'downloadTime' => strtotime('2000-01-01') * 1000,
        ]);
    }

    /**
     * @return bool|null
     */
    public function getCityList()
    {
        return $this->send('cityListService', [
            'downloadTime' => strtotime('2000-01-01') * 1000,
        ]);
    }

    /**
     * @return bool|null
     */
    public function getCountyList()
    {
        return $this->send('countyListService', [
            'downloadTime' => strtotime('2000-01-01') * 1000,
        ]);
    }
}